import {request} from "@/api";
import type {SysNotice} from "@/api/notice/types.ts";
import type {Page} from "@/api/types.ts";

const apiPrefix = '/varian-system/notice'

export const noticeApi = {
    add: (data: any) => request.post(`${apiPrefix}`, {data}),
    page: (params: any) => request.get<Page<SysNotice>>(`${apiPrefix}/page`, {params}),
    detail: (id: string) => request.get<SysNotice>(`${apiPrefix}/${id}`),
    modify: (data: SysNotice) => request.put(`${apiPrefix}/${data.id}`, {data}),
    delete: (id: string) => request.delete(`${apiPrefix}/${id}`),
    publish: (id: string) => request.put(`${apiPrefix}/publish/${id}`),
    revoke: (id: string) => request.put(`${apiPrefix}/revoke/${id}`),
}
